package cn.zhangtiancinb.simple_demo.exception_switch.server;

import javax.annotation.Resource;

import cn.hutool.core.bean.BeanUtil;
import org.springframework.stereotype.Component;
import org.springframework.context.annotation.Bean;
import cn.zhangtiancinb.simple_demo.exception_switch.client.ExceptionSwitchUtil;

/**
 * 配置项
 *
 * @author 张天赐
 */
@Component
public class Config {
    @Resource
    ExceptionSwitchConfigProperties exceptionSwitchConfig;

    @Bean
    public ExceptionSwitchUtil getExceptionSwitchUtil() {
        return ExceptionSwitchUtil.getInstance(BeanUtil.beanToMap(exceptionSwitchConfig));
    }
}
